<?php

namespace Mlym\CodeGeneration\InitGeneration\Authorization\Method;

use EasySwoole\EasySwoole\Config;
use EasySwoole\Http\Request;
use Mlym\CodeGeneration\ClassGeneration\MethodAbstract;

class Verify extends MethodAbstract
{
    function addMethodBody()
    {
        $this->classGeneration->getPhpNamespace()->addUse(Config::class);
        $this->method->addParameter('request')->setType(Request::class);
        $this->method
            ->setReturnType('void')
            ->setBody(<<<BODY
\$this->verifyToken(\$request);
BODY
            );
    }

    function getMethodName(): string
    {
        return 'verify';
    }
}